<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
DefaultOAuthProvider.Token (oauth-server 1.9 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="DefaultOAuthProvider.Token (oauth-server 1.9 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DefaultOAuthProvider.Token.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Consumer.html" title="class in com.sun.jersey.oauth.server.api.providers"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../../index.html?com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="DefaultOAuthProvider.Token.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.sun.jersey.oauth.server.api.providers</FONT>
<BR>
Class DefaultOAuthProvider.Token</H2>
<PRE>
java.lang.Object
  <IMG SRC="../../../../../../../resources/inherit.gif" ALT="extended by "><B>com.sun.jersey.oauth.server.api.providers.DefaultOAuthProvider.Token</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html" title="interface in com.sun.jersey.oauth.server.spi">OAuthToken</A></DD>
</DL>
<DL>
<DT><B>Enclosing class:</B><DD><A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.html" title="class in com.sun.jersey.oauth.server.api.providers">DefaultOAuthProvider</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>DefaultOAuthProvider.Token</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html" title="interface in com.sun.jersey.oauth.server.spi">OAuthToken</A></DL>
</PRE>

<P>
Simple immutable implementation of <A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html" title="interface in com.sun.jersey.oauth.server.spi"><CODE>OAuthToken</CODE></A>.
<P>

<P>
<HR>

<P>

<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html#DefaultOAuthProvider.Token(java.lang.String, java.lang.String, com.sun.jersey.oauth.server.api.providers.DefaultOAuthProvider.Token)">DefaultOAuthProvider.Token</A></B>(java.lang.String&nbsp;token,
                           java.lang.String&nbsp;secret,
                           <A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html" title="class in com.sun.jersey.oauth.server.api.providers">DefaultOAuthProvider.Token</A>&nbsp;requestToken)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html#DefaultOAuthProvider.Token(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)">DefaultOAuthProvider.Token</A></B>(java.lang.String&nbsp;token,
                           java.lang.String&nbsp;secret,
                           java.lang.String&nbsp;consumerKey,
                           java.lang.String&nbsp;callbackUrl,
                           java.util.Map&lt;java.lang.String,java.util.List&lt;java.lang.String&gt;&gt;&nbsp;attributes)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected </CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html#DefaultOAuthProvider.Token(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.security.Principal, java.util.Set, javax.ws.rs.core.MultivaluedMap)">DefaultOAuthProvider.Token</A></B>(java.lang.String&nbsp;token,
                           java.lang.String&nbsp;secret,
                           java.lang.String&nbsp;consumerKey,
                           java.lang.String&nbsp;callbackUrl,
                           java.security.Principal&nbsp;principal,
                           java.util.Set&lt;java.lang.String&gt;&nbsp;roles,
                           <A HREF="http://jsr311.java.net/nonav/releases/1.1/javax/ws/rs/core/MultivaluedMap.html?is-external=true" title="class or interface in javax.ws.rs.core">MultivaluedMap</A>&lt;java.lang.String,java.lang.String&gt;&nbsp;attributes)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html" title="class in com.sun.jersey.oauth.server.api.providers">DefaultOAuthProvider.Token</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html#authorize(java.security.Principal, java.util.Set)">authorize</A></B>(java.security.Principal&nbsp;principal,
          java.util.Set&lt;java.lang.String&gt;&nbsp;roles)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Authorizes this token - i.e.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://jsr311.java.net/nonav/releases/1.1/javax/ws/rs/core/MultivaluedMap.html?is-external=true" title="class or interface in javax.ws.rs.core">MultivaluedMap</A>&lt;java.lang.String,java.lang.String&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html#getAttributes()">getAttributes</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns additional custom attributes associated with the token.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html#getCallbackUrl()">getCallbackUrl</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns callback URL for this token (applicable just to request tokens)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthConsumer.html" title="interface in com.sun.jersey.oauth.server.spi">OAuthConsumer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html#getConsumer()">getConsumer</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns consumer this token was issued for.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.security.Principal</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html#getPrincipal()">getPrincipal</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <CODE>Principal</CODE> object containing the name of the
 user the request containing this token is authorized to act on behalf of.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html#getSecret()">getSecret</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the token secret.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html#getToken()">getToken</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns string representing the token.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html#isInRole(java.lang.String)">isInRole</A></B>(java.lang.String&nbsp;role)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a boolean indicating whether this token is authorized for the
 specified logical "role".</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="DefaultOAuthProvider.Token(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.security.Principal, java.util.Set, javax.ws.rs.core.MultivaluedMap)"><!-- --></A><H3>
DefaultOAuthProvider.Token</H3>
<PRE>
protected <B>DefaultOAuthProvider.Token</B>(java.lang.String&nbsp;token,
                                     java.lang.String&nbsp;secret,
                                     java.lang.String&nbsp;consumerKey,
                                     java.lang.String&nbsp;callbackUrl,
                                     java.security.Principal&nbsp;principal,
                                     java.util.Set&lt;java.lang.String&gt;&nbsp;roles,
                                     <A HREF="http://jsr311.java.net/nonav/releases/1.1/javax/ws/rs/core/MultivaluedMap.html?is-external=true" title="class or interface in javax.ws.rs.core">MultivaluedMap</A>&lt;java.lang.String,java.lang.String&gt;&nbsp;attributes)</PRE>
<DL>
</DL>
<HR>

<A NAME="DefaultOAuthProvider.Token(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map)"><!-- --></A><H3>
DefaultOAuthProvider.Token</H3>
<PRE>
public <B>DefaultOAuthProvider.Token</B>(java.lang.String&nbsp;token,
                                  java.lang.String&nbsp;secret,
                                  java.lang.String&nbsp;consumerKey,
                                  java.lang.String&nbsp;callbackUrl,
                                  java.util.Map&lt;java.lang.String,java.util.List&lt;java.lang.String&gt;&gt;&nbsp;attributes)</PRE>
<DL>
</DL>
<HR>

<A NAME="DefaultOAuthProvider.Token(java.lang.String, java.lang.String, com.sun.jersey.oauth.server.api.providers.DefaultOAuthProvider.Token)"><!-- --></A><H3>
DefaultOAuthProvider.Token</H3>
<PRE>
public <B>DefaultOAuthProvider.Token</B>(java.lang.String&nbsp;token,
                                  java.lang.String&nbsp;secret,
                                  <A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html" title="class in com.sun.jersey.oauth.server.api.providers">DefaultOAuthProvider.Token</A>&nbsp;requestToken)</PRE>
<DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="getToken()"><!-- --></A><H3>
getToken</H3>
<PRE>
public java.lang.String <B>getToken</B>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#getToken()">OAuthToken</A></CODE></B></DD>
<DD>Returns string representing the token.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#getToken()">getToken</A></CODE> in interface <CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html" title="interface in com.sun.jersey.oauth.server.spi">OAuthToken</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>string representing the token</DL>
</DD>
</DL>
<HR>

<A NAME="getSecret()"><!-- --></A><H3>
getSecret</H3>
<PRE>
public java.lang.String <B>getSecret</B>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#getSecret()">OAuthToken</A></CODE></B></DD>
<DD>Returns the token secret.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#getSecret()">getSecret</A></CODE> in interface <CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html" title="interface in com.sun.jersey.oauth.server.spi">OAuthToken</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>token secret</DL>
</DD>
</DL>
<HR>

<A NAME="getConsumer()"><!-- --></A><H3>
getConsumer</H3>
<PRE>
public <A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthConsumer.html" title="interface in com.sun.jersey.oauth.server.spi">OAuthConsumer</A> <B>getConsumer</B>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#getConsumer()">OAuthToken</A></CODE></B></DD>
<DD>Returns consumer this token was issued for.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#getConsumer()">getConsumer</A></CODE> in interface <CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html" title="interface in com.sun.jersey.oauth.server.spi">OAuthToken</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>consumer this token was issued for.</DL>
</DD>
</DL>
<HR>

<A NAME="getAttributes()"><!-- --></A><H3>
getAttributes</H3>
<PRE>
public <A HREF="http://jsr311.java.net/nonav/releases/1.1/javax/ws/rs/core/MultivaluedMap.html?is-external=true" title="class or interface in javax.ws.rs.core">MultivaluedMap</A>&lt;java.lang.String,java.lang.String&gt; <B>getAttributes</B>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#getAttributes()">OAuthToken</A></CODE></B></DD>
<DD>Returns additional custom attributes associated with the token.
 If this is a request token, this should be a the same set or a defined
 subset of parameters that were passed to the <CODE>OAuthProvider#newRequestToken(java.lang.String, java.lang.String, javax.ws.rs.core.MultivaluedMap)</CODE>
 method that created this request token. If this is an access token,
 this is any application defined set that will included as form parameters
 in a response to accessToken request.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#getAttributes()">getAttributes</A></CODE> in interface <CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html" title="interface in com.sun.jersey.oauth.server.spi">OAuthToken</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>immutable map of custom attributes</DL>
</DD>
</DL>
<HR>

<A NAME="getPrincipal()"><!-- --></A><H3>
getPrincipal</H3>
<PRE>
public java.security.Principal <B>getPrincipal</B>()</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#getPrincipal()">OAuthToken</A></CODE></B></DD>
<DD>Returns a <CODE>Principal</CODE> object containing the name of the
 user the request containing this token is authorized to act on behalf of.
 When the oauth filter verifies the request
 with this token is properly authenticated, it injects this token into a security context
 which then delegates <A HREF="http://jsr311.java.net/nonav/releases/1.1/javax/ws/rs/core/SecurityContext.html?is-external=true#getUserPrincipal()" title="class or interface in javax.ws.rs.core"><CODE>SecurityContext.getUserPrincipal()</CODE></A> to this
 method.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#getPrincipal()">getPrincipal</A></CODE> in interface <CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html" title="interface in com.sun.jersey.oauth.server.spi">OAuthToken</A></CODE></DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>Principal corresponding to this token, or null if the token is not authorized</DL>
</DD>
</DL>
<HR>

<A NAME="isInRole(java.lang.String)"><!-- --></A><H3>
isInRole</H3>
<PRE>
public boolean <B>isInRole</B>(java.lang.String&nbsp;role)</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#isInRole(java.lang.String)">OAuthToken</A></CODE></B></DD>
<DD>Returns a boolean indicating whether this token is authorized for the
 specified logical "role". When the oauth filter verifies the request
 with this token is properly authenticated, it injects this token into a security context
 which then delegates <A HREF="http://jsr311.java.net/nonav/releases/1.1/javax/ws/rs/core/SecurityContext.html?is-external=true#isUserInRole(java.lang.String)" title="class or interface in javax.ws.rs.core"><CODE>SecurityContext.isUserInRole(java.lang.String)</CODE></A> to this
 method.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html#isInRole(java.lang.String)">isInRole</A></CODE> in interface <CODE><A HREF="../../../../../../../com/sun/jersey/oauth/server/spi/OAuthToken.html" title="interface in com.sun.jersey.oauth.server.spi">OAuthToken</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>role</CODE> - a <code>String</code> specifying the name of the role
<DT><B>Returns:</B><DD>a <code>boolean</code> indicating whether this token is authorized for
 a given role</DL>
</DD>
</DL>
<HR>

<A NAME="getCallbackUrl()"><!-- --></A><H3>
getCallbackUrl</H3>
<PRE>
public java.lang.String <B>getCallbackUrl</B>()</PRE>
<DL>
<DD>Returns callback URL for this token (applicable just to request tokens)
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>callback url</DL>
</DD>
</DL>
<HR>

<A NAME="authorize(java.security.Principal, java.util.Set)"><!-- --></A><H3>
authorize</H3>
<PRE>
protected <A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html" title="class in com.sun.jersey.oauth.server.api.providers">DefaultOAuthProvider.Token</A> <B>authorize</B>(java.security.Principal&nbsp;principal,
                                               java.util.Set&lt;java.lang.String&gt;&nbsp;roles)</PRE>
<DL>
<DD>Authorizes this token - i.e. generates a clone with principal and roles set
 to the passed values.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>principal</CODE> - Principal to add to the token.<DD><CODE>roles</CODE> - Roles to add to the token.
<DT><B>Returns:</B><DD>Cloned token with the principal and roles set.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DefaultOAuthProvider.Token.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../../com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Consumer.html" title="class in com.sun.jersey.oauth.server.api.providers"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../../index.html?com/sun/jersey/oauth/server/api/providers/DefaultOAuthProvider.Token.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="DefaultOAuthProvider.Token.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2011 <a href="http://www.oracle.com/">Oracle Corporation</a>. All Rights Reserved.
</BODY>
</HTML>
